﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using DotNet.AbstartAndInterface;

using Dapper;
using System.Data;

namespace DotNet
{
    class Program
    {

        volatile static bool isStop = false;

        static void Main(string[] args)
        {
            {
                Console.WriteLine($"-------------------------5. 字典对象初始化-------------------------");
                Dictionary<string, string> dicList = new Dictionary<string, string>()
                {
                    ["1"] = "ypf1",
                    ["2"] = "ypf2",
                    ["3"] = "ypf3"
                };
                Dictionary<string, string> dicList2 = new Dictionary<string, string>()
                {
                     { "1","lmr1"},
                     { "2","lmr2"},
                     { "3","lmr3"}
                };
                foreach (var item in dicList)
                {
                    Console.WriteLine("key:{0},value:{1}", item.Key.ToString(), item.Value.ToString());
                }
                foreach (var item in dicList2)
                {
                    Console.WriteLine("key:{0},value:{1}", item.Key.ToString(), item.Value.ToString());
                }
            }

            int b = 10_000_000;

            object obj = new object();
            switch (obj)
            {
                case int a:
                    Console.WriteLine(a);
                    break;

                case string s:
                    Console.WriteLine(b);
                    break;
            }

            Console.ReadLine();
        }

        public static void Method1(out string s1)
        {
            s1 = "string";
        }

        public static List<Person> Query()
        {
            var usersList = Enumerable.Range(0, 10).Select(i => new Person()
            {
                UserName = i + "jack"
            });


            using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(""))
            {
                return connection.Query<Person>("select * from Person").ToList();
            }

            

        }

    }
    public class Person
    {
        public string UserName { get; set; }
    }
}
